<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<center>
		<form action="add" method="post">
			<table>
				<tr>
					<td>用户名</td>
					<td><input type="text" id="name" name="name"><span id="a"></span></td>
				</tr>
				<tr>
					<td>密码</td>
					<td><input type="text" name="pwd"><span id="b"></span></td>
				</tr>
				<tr>
					<td>确认密码</td>
					<td><input type="text" name="rpwd"><span id="c"></span></td>
				</tr>
				<tr>
					<td><input type="submit" value="提交"></td>
					<td></td>
				</tr>
		  </table>
		</form>
	</center>
</body>
</html>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script>
	$(document).on("blur","#name",function(){ 
        var val=$(this).val();
        if(val==''){
          alert("不可以为空");
        }
	 })
</script>